package com.zdxc.controller;


import com.zdxc.entities.Taskplan;
import com.zdxc.entities.Userinfo;
import com.zdxc.service.TaskPlanService;
import com.zdxc.service.UserService;
import common.bean.Paging;
import common.bean.ResultJsonWrap;
import common.util.StringEncrypt;
import common.util.UserInfoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="/plan/*")
public class PlanController {
    @Autowired
    private TaskPlanService planService;

    @RequestMapping("/getDetail")
    @ResponseBody
    public Taskplan getDetail(@RequestParam("sPlanId") String sPlanId){
       return  this.planService.findTaskplanById(sPlanId);
    }

    /**
     * 分页返回
     * @param plan
     * @param paging
     * @return
     */
    @RequestMapping("/getcondition")
    @ResponseBody
    public Paging planlist(Taskplan plan, Paging paging){
        Paging resultPage =planService.findByCondition(plan,paging);
        return  resultPage;
    }


    @RequestMapping(value="/list")
    public String list(){
        return "plan/list";
    }



}
